Skip to content

scaffold: local metadata methods + response capture (host-local recall)#67

Merged
Alexgodoroja merged 1 commit into
pilot-protocol:mainfrom
Alexgodoroja:agentphone-local-metadata
Jul 4, 2026
Merged

scaffold: local metadata methods + response capture (host-local recall)#67
Alexgodoroja merged 1 commit into
pilot-protocol:mainfrom
Alexgodoroja:agentphone-local-metadata

Conversation

@Alexgodoroja

Copy link
Copy Markdown
Collaborator

Lets an HTTP app persist a method's result to a host-local JSON file and read it back with a backend-free local method — so an agent recalls host-local state without a round-trip. Built for AgentPhone: buy_number writes the provisioned number to ~/.pilot/.agentphone, and agentphone.mynumber reads it.

  • method.local: {store} — a local read (no http/cli route); returns the store's JSON (or {"entries":[]} when absent). Shows as plane local in <ns>.help.
  • http.capture_to — after a 2xx, best-effort append the response to the store's "entries" array (deduped by id); a capture failure never fails the call.
  • Auto-grants fs.read (+ fs.write for capture targets) on the store, ~$HOME normalized (the adapter expands ~ at runtime, so grant == opened path).
  • The rich submission carries local.store + http.capture_to through ToConfig; validation rejects a method declaring both a local and a backend route.

Tests: generate+compile a managed-HTTP app with capture + local read, asserting dispatcher wiring, the $HOME grants, and validation. Full suite green.

@Alexgodoroja Alexgodoroja force-pushed the agentphone-local-metadata branch from 84743dc to bdd3684 Compare July 4, 2026 02:50
An HTTP app can now persist a method's result to a host-local JSON file and read
it back with a backend-free local method — so an agent recalls host-local state
without a round-trip (e.g. agentphone: buy_number writes the provisioned number
to ~/.pilot/.agentphone; mynumber reads it).

- Method.local {store} — a local read (no http/cli route); returns the store's
  JSON, or {"entries":[]} when absent. Plane "local" in <ns>.help.
- HTTPRoute.capture_to — after a 2xx, best-effort append the response to the
  store's "entries" array (deduped by id). A capture failure never fails the call.
- Manifest auto-grants fs.read (+ fs.write for capture targets) on the store,
  with ~ normalized to $HOME (adapter expands ~ at runtime, so grant == path).
- Submission (rich) carries local.store + http.capture_to through ToConfig;
  validation rejects a method with both a local and a backend route.

Tests: generate+compile a managed-http app with capture + local read, asserting
the dispatcher wiring, the $HOME grants, and validation rules. Full suite green.
@Alexgodoroja Alexgodoroja merged commit ea880d0 into pilot-protocol:main Jul 4, 2026
6 checks passed
Alexgodoroja pushed a commit to Alexgodoroja/app-template that referenced this pull request Jul 4, 2026
…cal number recall

Managed AgentPhone app: keyless adapter → Pilot broker (holds the master key,
meters each user against a $5 budget → 402) → https://api.agentphone.ai.

- 53 methods covering every non-streaming /v1 endpoint (agents, numbers, messages,
  calls, conversations, contacts, contact-cards, usage, voices, webhooks). Every
  method described; params tagged path/query/body. No websockets — poll for status.
- Local number recall: buy_number captures the provisioned number to
  ~/.pilot/.agentphone; agentphone.mynumber reads it back locally (no round-trip).
- verify-submission builds + verifies darwin/linux amd64+arm64.

Requires the broker credit gate (pilot-protocol#64) + method-aware costs (pilot-protocol#66) + local-metadata
scaffold (pilot-protocol#67), all merged.
Alexgodoroja added a commit that referenced this pull request Jul 4, 2026
…cal number recall (#65)

Managed AgentPhone app: keyless adapter → Pilot broker (holds the master key,
meters each user against a $5 budget → 402) → https://api.agentphone.ai.

- 53 methods covering every non-streaming /v1 endpoint (agents, numbers, messages,
  calls, conversations, contacts, contact-cards, usage, voices, webhooks). Every
  method described; params tagged path/query/body. No websockets — poll for status.
- Local number recall: buy_number captures the provisioned number to
  ~/.pilot/.agentphone; agentphone.mynumber reads it back locally (no round-trip).
- verify-submission builds + verifies darwin/linux amd64+arm64.

Requires the broker credit gate (#64) + method-aware costs (#66) + local-metadata
scaffold (#67), all merged.

Co-authored-by: Alex Godoroja <alex@vulturelabs.io>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant